#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int removeElement(int* nums, int numsSize, int val) {
    int src = 0;
    int des = 0;
    while (src < numsSize) {
        if (nums[src] == val) {
            src++;
        }
        else {
            nums[des] = nums[src];
            src++;
            des++;
        }
    }
    return des;
}
int main() {
    int nums[] = { 2,9,3,4,5 };

    printf("%d", removeElement(nums, 5, 2));

    return 0;
}